<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>算数对象</title>
</head>
<body>

</body>
<script>

    /*
     * random
     * round
     * ceil
     * floor
    * */

    var rnd = Math.random();

    var num =Math.round(rnd*10)
    document.write(num+"<br/>");

    function getNum() {
        var rnd = Math.random(); // 0-1
        return   Math.ceil( rnd*(10-1)) +1
    }

    function getRnd(min,max) {
        var rnd = Math.random(); // 0-1
        return   Math.ceil( rnd*(max-min)) +min;
    }
    var num2 = getRnd(10,20);
    document.write(num2)

    var arr=[];

    for (var i=0;i<10;i++){
        var res= getRnd(10,30);
        arr.push(res);
    }

    console.log(arr);

</script>
</html>